package route

import (
	"github.com/gogf/gf/v2/net/ghttp"
	"github.com/gogf/gf/v2/os/gcfg"
	"github.com/gogf/gf/v2/os/glog"
)

type CfgCtrl struct {
}

func (c *CfgCtrl) Query(r *ghttp.Request) {
	instance := gcfg.Instance()
	data, _ := instance.Data(r.GetCtx())
	r.Response.WriteJsonExit(map[string]interface{}{"instance": data})
}

func (c *CfgCtrl) Init(r *ghttp.Request) {
	glog.Info(r.GetCtx(), "调用了 /cfg 对象的方法！")
}

func (c *CfgCtrl) Shut(r *ghttp.Request) {
	glog.Info(r.GetCtx(), "结束调用了 /cfg 对象的方法！")
}
